package com.xiaoxing.salesclient.mvp.ui.adapter;

import android.content.Context;
import android.support.annotation.Nullable;
import android.widget.ImageView;

import com.alibaba.android.arouter.utils.TextUtils;
import com.bumptech.glide.Glide;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.xiaoxing.salesclient.mvp.model.entity.ProcessList;

import java.util.List;

import me.jessyan.armscomponent.commonres.utils.GlideUtil;
import xiaoxing.com.salesclient.R;


public class SopLiuChengAdapter extends BaseQuickAdapter<ProcessList.DataBean, BaseViewHolder> {
    private Context mContext;

    public SopLiuChengAdapter(Context context, @Nullable List<ProcessList.DataBean> data) {
        super(R.layout.item_sop_liu_cheng_list, data);
        this.mContext = context;
    }

    @Override
    protected void convert(BaseViewHolder helper, ProcessList.DataBean item) {
//        Glide.with(mContext).load(item.getCover()).into((ImageView) helper.getView(R.id.img));
        GlideUtil.loadRoundImage(mContext, item.getCover(), (ImageView) helper.getView(R.id.img), R.drawable.default_small_img);

        String nickname = TextUtils.isEmpty(item.getNick_name()) ? "" : item.getNick_name();
        helper.setText(R.id.tv_name, nickname + "-" + item.getNum() + "流程");
    }

}
